﻿/*******************************************************************************
 * Copyright © 2017 FriendStar.Framework 版权所有
 * Author: FZH
 * Description: FriendStar快速开发平台
 * Website：http://www.FriendStar.cn
*********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;
using FriendStar.Code;
using FriendStar.Domain.Entity.BOM;
using FriendStar.Domain.IRepository.BOM;
using FriendStar.Repository.BOM;

namespace FriendStar.Application.BOM
{
    /// <summary>
	/// 数据视图 V_GYK_43_CY_TecGXData_DA 对应的数据应用功能类。
	/// </summary>
	public class V_GYK_43_CY_TecGXData_DAApp
    {       
        private string UseUnit = Configs.GetValue("UseUnit");  

        private IV_GYK_43_CY_TecGXData_DARepository service = new V_GYK_43_CY_TecGXData_DARepository();

        public List<V_GYK_43_CY_TecGXData_DAEntity> GetList(Pagination pagination, string FProductionNO, string ProcessNO)
        {
            var expression = ExtLinq.True<V_GYK_43_CY_TecGXData_DAEntity>();
            expression = expression.And(t => t.UseUnit == UseUnit);
            if (!string.IsNullOrEmpty(FProductionNO))
            {
                expression = expression.And(t => t.FProductionNO.Contains(FProductionNO));
            }
            if (!string.IsNullOrEmpty(ProcessNO))
            {
                expression = expression.And(t => t.ProcessNO.Contains(ProcessNO));
            }
            return service.FindList(expression, pagination);
        }
    }
}